namespace ZSoft.Telegram.DataAccess.Migrations
{
    using System;
    using System.Data.Entity.Migrations;
    
    using System.Linq;
    using System.Data.Entity;
    using Domain.User;
    using System.Collections.Generic;

    internal sealed class Configuration : DbMigrationsConfiguration<ZSoft.Telegram.DataAccess.ApplicationDbContext>
    {
        public Configuration()
        {
            AutomaticMigrationsEnabled = true;
        }

        protected override void Seed(ApplicationDbContext context)
        {
            //context.PinBoards.Add(new Domain.Board.PinBoard()
            //{
            //    Date = DateTime.Now,
            //});

            //this.AddSamplePins(context);
            //  This method will be called after migrating to the latest version.

            //  You can use the DbSet<T>.AddOrUpdate() helper extension method 
            //  to avoid creating duplicate seed data. E.g.
            //
            //    context.People.AddOrUpdate(
            //      p => p.FullName,
            //      new Person { FullName = "Andrew Peters" },
            //      new Person { FullName = "Brice Lambson" },
            //      new Person { FullName = "Rowan Miller" }
            //    );
            //
        }

        private void AddSamplePins(ApplicationDbContext context)
        {
            //var board = new PinBoard()
            //{
            //    Date = DateTime.Now,
            //    Description = "This board is going to be used for computer science",
            //    Name = "Computer Science",
            //    User = context.Users.Include("PinBoards").First(u => u.UserName == "a@b.com"),
            //    Pins = new List<Pin>()
            //};

            //for (int i = 0; i < 10; i++)
            //{
            //    Pin pin = new Pin()
            //    {
                    
            //    };

            //    board.Pins.Add(pin);
            //    context.Pins.Add(pin);
            //}
                                   
        }
    }
}
